package com.centerm.common.constant.enums.project;

import com.centerm.common.constant.StatusCode;

public enum ReviewResultStatus implements StatusCode {
    
    NOT_PASS(0, "不通过"),
    PASS(1, "通过");

    private Integer code;
    private String description;
    
    private ReviewResultStatus(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getDescription() {
        return this.description;
    }

    public static ReviewResultStatus getByCode(Integer code) {
        for(ReviewResultStatus status : ReviewResultStatus.values()) {
            if(status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }

    public static String getDescriptionByCode(Integer code) {
        for(ReviewResultStatus status : ReviewResultStatus.values()) {
            if(status.getCode().equals(code)) {
                return status.getDescription();
            }
        }
        return null;
    }
}
